﻿using Microsoft.EntityFrameworkCore.Migrations;

namespace EF_Cord.Migrations
{
    public partial class S2 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Powers",
                columns: table => new
                {
                    WId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    WName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    KId = table.Column<int>(type: "int", nullable: false),
                    PowersWId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Powers", x => x.WId);
                    table.ForeignKey(
                        name: "FK_Powers_Powers_PowersWId",
                        column: x => x.PowersWId,
                        principalTable: "Powers",
                        principalColumn: "WId",
                        onDelete: ReferentialAction.Restrict);
                });

            migrationBuilder.CreateIndex(
                name: "IX_Powers_PowersWId",
                table: "Powers",
                column: "PowersWId");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Powers");
        }
    }
}
